home *** CD-ROM | disk | FTP | other *** search
- /* ***** BEGIN LICENSE BLOCK *****
- *
- * Pearltrees add-on AMO, Copyright(C), 2009, Broceliand SAS, Paris, France
- * (company in charge of developing Pearltrees)
- *
- * This file is part of ΓÇ£Pearltrees add-on AMOΓÇ¥.
- *
- * Pearltrees add-on AMO is free software: you can redistribute it and/or modify it under the
- * terms of the GNU General Public License version 3 as published by the Free Software Foundation.
- *
- * Pearltrees add-on AMO is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
- * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
- * See the GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along with Pearltrees add-on AMO.
- * If not, see <http://www.gnu.org/licenses/>
- *
- * ***** END LICENSE BLOCK ***** */
-
- /////////////////////////////////////////////////////////////////////////////////
- // Debugging tools
- /////////////////////////////////////////////////////////////////////////////////
- /**
- * You can log messages by using BRO_log.log('your message');
- */
- var BRO_log = {
-
- _consoleService:null,
-
- init:function() {
- this._consoleService = Components.classes['@mozilla.org/consoleservice;1'].
- getService(Components.interfaces.nsIConsoleService);
- },
-
- /**
- * Log messages into the javascript console
- * @param string message
- */
- log:function(msg) {
- this._consoleService.logStringMessage('[BRO_toolbar] ' + msg);
- },
-
- /**
- * Crital error
- * @param string msg
- */
- error:function(msg) {
- if(BRO_toolbar.isRecording) {
- BRO_ButtonsHandler.stopRecording();
- }
- this.log('Critical error - '+msg);
-
- var prompts = Components.classes["@mozilla.org/embedcomp/prompt-service;1"]
- .getService(Components.interfaces.nsIPromptService);
- prompts.alert(null, BRO_locale.getString('popup.error.title'), msg);
- },
-
- warning:function(msg) {
- if(BRO_toolbar.isRecording) {
- BRO_ButtonsHandler.stopRecording();
- }
- this.log('Warning - '+msg);
-
- var prompts = Components.classes["@mozilla.org/embedcomp/prompt-service;1"]
- .getService(Components.interfaces.nsIPromptService);
- prompts.alert(null, BRO_locale.getString('popup.error.title'), msg);
- },
-
- info:function(msg) {
- if(BRO_toolbar.isRecording) {
- BRO_ButtonsHandler.stopRecording();
- }
- this.log('Warning - '+msg);
-
- var prompts = Components.classes["@mozilla.org/embedcomp/prompt-service;1"]
- .getService(Components.interfaces.nsIPromptService);
- prompts.alert(null, "", msg);
- }
-
- }